@if(count($topics))
    <ul class="list-group">
        @foreach($topics as $topic)
            <li class="list-group-item border-0 border-bottom d-flex align-items-center">
                <a href="{{route('users.show',$topic->user_id)}}" class="flex-shrink-0">
                    @if(!empty($topic->user->avatar))
                        <img width="50" class="img-thumbnail"
                             src="{{$topic->user->avatar}}" alt="{{$topic->user->name}}">
                    @else
                        <img width="50" class="img-thumbnail"
                             src="{{url('fakers/avatars/face1.jpg')}}" alt="{{$topic->user->name}}">
                    @endif
                </a>
                <div class="flex-grow-1 px-2 d-flex flex-column">
                    <a class="text-decoration-none text-success" href="{{$topic->link()}}">
                      {{$topic->title}}
                    </a>
                    <small>
                        <a href="{{route('categories.show',$topic->category_id)}}"
                           class="text-secondary text-decoration-none"
                           title="{{$topic->category->name}}"
                        >
                            <i class="fa-regular fa-folder-closed"></i>
                            {{$topic->category->name}}
                        </a>
                        <span class="text-secondary">  •   </span>
                        <a href="{{route('users.show',$topic->user_id)}}" class="text-secondary text-decoration-none">
                            <i class="fa-regular fa-user"></i>
                            {{$topic->user->name}}
                        </a>
                        <span class="text-secondary">  •   </span>
                        <span  class="text-secondary">
                                      <i class="fa-regular fa-clock"></i>
                                        {{$topic->created_at->diffForHumans()}}
                                    </span>
                    </small>
                </div>
                <a  href="{{$topic->link()}}"
                    class="badge my_link text-decoration-none text-bg-{{$topic->reply_count > 0 ? 'danger' : 'secondary'}}">
                    {{$topic->reply_count}}
                </a>
            </li>
        @endforeach
    </ul>
    {{--       分页           --}}
    <div class="d-flex justify-content-end py-4">
        {!! $topics->appends(Request::except('page'))->render() !!}
    </div>
@else
    @include('shared._no_data',['info'=>'暂无帖子'])
@endif
